<%@ page import="com.po.Note" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Note> notes = (List<Note>) request.getAttribute("notes");
%>
<title>游客登录</title>
<h3>纸条如下:</h3>
<table>
    <tr>
        <td>引用内容</td>
        <td>纸条名字</td>
        <td colspan="3">纸条内容</td>
        <td>创建时间</td>
        <td>获赞数量</td>
    </tr>
    <%
        if (notes.isEmpty()) {
    %>
    <div style="text-align: center">
        <h4>该信封还没有纸条</h4>
    </div>
    <%
    } else {
        for (Note note : notes) {
    %>
    <tr>
        <<%
        if(!"无".equals(note.getQuote())){
    %>
        <td><a href="<%=request.getContextPath()%>/quoteNote?content=<%=note.getQuote()%>"><%=note.getQuote()%>
        </a>
        </td>
        <%
        }else{
        %>
        <td></td>
        <%
            }
        %>
        <td><%=note.getNote_name()%></td>
        <td colspan="3"><%=note.getContent()%></td>
        <td><%=note.getCreate_time()%></td>
        <td><%=note.getPriase_number()%></td>
        <td><button onclick="window.location.href='<%=request.getContextPath()%>/tourist/comment?note_id=<%=note.getNote_id()%>&note_name=<%=note.getNote_name()%>&note_content=<%=note.getContent()%>'">前往评论区</button></td>
    </tr>

    <%
            }
        }
    %>
    <style>
        table {
            width: 650px;
            margin: auto;
            border: pink 1px solid;
            border-spacing: 0px;
            border-collapse: collapse;
        }

        td {
            border: pink 1px solid;
        }
        body{
            background-image: url("../picture/new.jpg");
            background-repeat: no-repeat;
            background-attachment: fixed;
            background-position: center center;
            background-size: 100% 100%;
        }
    </style>
</table>